﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using HHo_Model;
using HHo_Negocio;
using System.Collections.Generic;

public partial class mantenimientos_wfManSubATA : System.Web.UI.Page
{
    E_SubATA eSubATA;
    GestorSubATA oGesSubATA;
    List<E_SubATA> lst;

    protected void Page_Load(object sender, EventArgs e)
    {
        //ACTIVAR GESTION SCRIPT DE PAGINA
        this.ClientScript.GetPostBackEventReference(this, string.Empty);

        if (Request.Form["__eventtarget"] == "ActualizarGrid")
        {
            gvData.DataSource = PoblarGrid();
            gvData.DataBind();
        }

        if (!Page.IsPostBack)
        {
        }
    }

    private List<E_SubATA> PoblarGrid()
    {
        eSubATA = new E_SubATA();
        oGesSubATA = new GestorSubATA();
        lst = new List<E_SubATA>();

        eSubATA.CodATA = txtCodATA.Text;
        eSubATA.CodSubATA = txtCodSATA.Text;
        eSubATA.Desc = txtDesc.Text;

        lst = oGesSubATA.Man_ConsultaSubATA(eSubATA);

        return lst;
    }


    protected void imgConsultar_Click(object sender, ImageClickEventArgs e)
    {
        gvData.DataSource = PoblarGrid();
        gvData.DataBind();
    }
}
